package com.shenhaofeng.demo;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.shenhaofeng.app.component.BaseActivity;
import com.trello.rxlifecycle.android.ActivityEvent;

import java.util.List;

import rx.Observable;
import rx.functions.Func1;


/**
 * Created by Administrator on 2016/9/29.
 */
public class MdActivity extends BaseActivity {

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.layout);
        getSupportFragmentManager().beginTransaction().add(R.id.layout,new Fragment1(),null).commit();

    }


    public static class Fragment1 extends Fragment {

        @Nullable
        @Override
        public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
            TextView imageView = new TextView(getContext());
            imageView.setText("asdasdasd");
            imageView.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    TargetActivity.launch(getActivity(), v);
                }
            });
            return imageView;
        }
    }
}
